<?php
	require_once ("db_connection.php");

	$date = date("Y-m-d H:i:s");
	$affiliateid = $_POST['affiliateid'];
	
	/*start add to hourlyrate table*/
		$hrid = "HR-" . uniqid();
		$minimumhr = $_POST["minimumhourly"];
		$ratehourly = $_POST["ratehourly"];

		$queryhourly = "INSERT INTO hourlyrate(hourlyid,affiliateid,vehicletype,vehiclemodel,minimumhr, currency, rate, date)
		VALUES('$hrid','$affiliateid','$_POST[vehicletype]','$_POST[vehiclemodelhourly]','$minimumhr','$_POST[currencyhourly]', '$ratehourly', '$date')";
		
		if(!mysql_query($queryhourly, $con)){
			die('Error: '. mysql_error());
		}
	/*end add to hourlyrate table*/


	echo "Saved! ";
	flush();
	mysql_close($con);
?>